/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package a1A;

/**
 *
 * @author nisarg^
 */
public class alien_language {
    public static void main(String args[]) {
        String input = "abdaa", temp = "";
        String input1[] = {"aaa","bcd","def"};
        String check = "(abchd)(alhce)(fbhcd)";
        int i = 0, k = 0, brk = 0, count = 0;
        try {
            for(count = 0;count<3;count++) {
                //System.out.println("123");
                temp = "";
                k=0;
                brk=0;
                for(i=0;i<check.length();i++)
                    if(check.charAt(i)=='(') {
                        while(check.charAt(i) != ')')   temp += check.charAt(i++);
                            if(temp.indexOf(input1[count].charAt(k))>=0) {
                                k++;
                                temp = "";
                            }
                            else brk = 1;
                        }
                    else {
                        if(k>input1[count].length()) {
                            brk = 1;
                            break;
                        }
                        if(input1[count].charAt(k)!=check.charAt(i)) {
                            brk = 1;
                        }
                        k++;
                    }
                    if(brk == 1) System.out.println("Not Done");
                    else System.out.println("Done");
                }
            } catch(Exception e) {
            System.out.println("Not Done111");
        }
    }
}